package com.emeraldparser.util;

import java.util.AbstractCollection;
import java.util.Iterator;
import java.util.Set;

import com.google.common.base.Objects;
import com.google.common.collect.Multiset;

public abstract class AbstractMultiset<E> extends AbstractCollection<E> implements Multiset<E> {

	@Override
	public abstract Set<Multiset.Entry<E>> entrySet();

	private Multiset.Entry<E> entry(Object element) {
		for (Multiset.Entry<E> entry : entrySet()) {
			if (Objects.equal(element, entry.getElement())) {
				return entry;
			}
		}
		
		return null;
	}

	@Override
	public int count(Object element) {
		// TODO Auto-generated method stub
		Multiset.Entry<E> entry = entry(element);
		if (entry == null) {
			return 0;
		}
		return entry.getCount();
	}

	@Override
	public int add(E element, int occurrences) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int remove(Object element, int occurrences) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int setCount(E element, int count) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public boolean setCount(E element, int oldCount, int newCount) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Set<E> elementSet() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Iterator<E> iterator() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int size() {
		// TODO Auto-generated method stub
		return 0;
	}

}
